Forward old API documentation url to new API documentation url, #PG-5032#958
Open
lachiebol wants to merge 2 commits into
Open
Forward old API documentation url to new API documentation url, #PG-5032#958lachiebol wants to merge 2 commits into
lachiebol wants to merge 2 commits into
Conversation
…er pages, updated script to use ApiReference instead of OpenApiDocs
Contributor
Author
|
@AltamashShaikh We should merge when Cloud gets updated with new ApiReference |
Contributor
AltamashShaikh
left a comment
There was a problem hiding this comment.
@lachiebol Can you check this ?
High-Risk Issues Blocking
- Legacy hash forwarding is incomplete for existing documented links. The redirect only maps window.location.hash when it exactly equals a generated
pluginSpec.pluginName in app/templates/api-legacy-redirect.twig:12. Existing docs still contain links like /api-reference/reporting-api#TagManager, /api-
reference/reporting-api#SitesManager, /api-reference/reporting-api#api-method-list, and /api-reference/reporting-api#optional-api-parameters. If the hash is not
present in pluginSpecs, users are sent to the generic /api-reference/api index instead of either the matching new page or the preserved legacy anchor. This is
especially visible because the branch text says “Old reporting API links now redirect here” in app/templates/api-swagger-index.twig:19, but many old links will
not land on the intended content.
Medium-Risk Issues
- The redirect is client-side only. That is probably necessary for fragment-based redirects because URL hashes are not sent to the server, but non-JS users and
crawlers only get the fallback content. The <noscript> meta refresh points to /api-reference/api and cannot preserve anchors in app/templates/api-legacy-
redirect.twig:5.
Contributor
Author
@AltamashShaikh First one is a valid concern, fixed that one. The second one should be fine, if someone is using no js it should probably just take them to the new page. |
Contributor
AltamashShaikh
left a comment
There was a problem hiding this comment.
@lachiebol It still says
This fixes only #api-method-list. Other existing legacy hashes like #optional-api-parameters, #TagManager, #SitesManager, #FormAnalytics, #HeatmapSessionRecording,
#MediaAnalytics, and #CrashAnalytics still fall through to /api-reference/api#hash. In this checkout, the generated OpenAPI specs only include CustomTranslations,
GithubAnalytics, LogViewer, LoginLdap, and TreemapVisualization, so most of those hashes will not map to a new plugin page.
The safer fix is to change the final fallback to:
targetUrl = legacyUrl + '#' + hash;
Contributor
Author
It works, because all of the other hash params match sections in the current page. Something like this should work |
AltamashShaikh
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Also added legacy links to actual swagger pages. And changed OpenApiDocs to ApiReference
Checklist
Review